<html>
<head><meta charset="utf-8"><title>How to not get span info in json output for --bless · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20not.20get.20span.20info.20in.20json.20output.20for.20--bless.html">How to not get span info in json output for --bless</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246348850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20not%20get%20span%20info%20in%20json%20output%20for%20--bless/near/246348850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20not.20get.20span.20info.20in.20json.20output.20for.20--bless.html#246348850">(Jul 17 2021 at 23:05)</a>:</h4>
<p>I'm working on <a href="https://github.com/rust-lang/rust/issues/87217">#87217</a> and I have written a test but I get the following output when I try to use <code>--bless</code></p>
<div class="codehilite"><pre><span></span><code>unexpected errors (from JSON output): [
    Error {
        line_num: 9,
        kind: Some(
            Note,
        ),
        msg: &quot;9:8: 9:13: keyword order for functions declaration is `&lt;visibility&gt;`, `const`, `async`, `unsafe`, `extern`, `\&quot;&lt;ABI&gt;\&quot;`&quot;,
    },
    Error {
        line_num: 9,
        kind: Some(
            Help,
        ),
        msg: &quot;9:1: 9:13: `const` must come before `unsafe`&quot;,
    },
]

not found errors (from test file): [
    Error {
        line_num: 9,
        kind: Some(
            Note,
        ),
        msg: &quot;keyword order for functions declaration is `&lt;visibility&gt;`, `const`, `async`, `unsafe`, `extern`, `\\\&quot;&lt;ABI&gt;\\\&quot;`&quot;,
    },
    Error {
        line_num: 9,
        kind: Some(
            Help,
        ),
        msg: &quot;`const` must come before `unsafe`: `const unsafe`&quot;,
    },
]
</code></pre></div>
<p>The difference is in <code>msg</code>: there is the span information <code>9:1: 9:13: </code> but I'm pretty sure I never explicitely introduce it anywhere and existing tests don't have this problem, what am I doing wrong ?</p>



<a name="246349215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20not%20get%20span%20info%20in%20json%20output%20for%20--bless/near/246349215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20not.20get.20span.20info.20in.20json.20output.20for.20--bless.html#246349215">(Jul 17 2021 at 23:16)</a>:</h4>
<p><span class="user-mention" data-user-id="307289">@Poliorcetics</span> the first one looks like the backslashes are wrong. The second one includes the help suggestion, which it shouldn't. Use //~| SUGGESTION for that.</p>



<a name="246349223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20not%20get%20span%20info%20in%20json%20output%20for%20--bless/near/246349223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20not.20get.20span.20info.20in.20json.20output.20for.20--bless.html#246349223">(Jul 17 2021 at 23:17)</a>:</h4>
<p>Err that may not be the right syntax, but I know it's a different directive</p>



<a name="246349528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20not%20get%20span%20info%20in%20json%20output%20for%20--bless/near/246349528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20not.20get.20span.20info.20in.20json.20output.20for.20--bless.html#246349528">(Jul 17 2021 at 23:25)</a>:</h4>
<p>I'm using this code for the test:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="c1">// edition:2018</span>

<span class="k">unsafe</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">test</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="c1">//~^ ERROR expected one of `extern` or `fn`, found keyword `const`</span>
<span class="c1">//~| NOTE expected one of `extern` or `fn`</span>
<span class="c1">//~| NOTE keyword order for functions declaration is `&lt;visibility&gt;`, `const`, `async`, `unsafe`, `extern`, `"&lt;ABI&gt;"`</span>
<span class="c1">//~| HELP `const` must come before `unsafe`: `const unsafe`</span>
<span class="c1">//~| SUGGESTION const unsafe</span>
</code></pre></div>



<a name="246349608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20not%20get%20span%20info%20in%20json%20output%20for%20--bless/near/246349608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20not.20get.20span.20info.20in.20json.20output.20for.20--bless.html#246349608">(Jul 17 2021 at 23:27)</a>:</h4>
<p>Oh, I understand what you're saying</p>



<a name="246349612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20not%20get%20span%20info%20in%20json%20output%20for%20--bless/near/246349612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20not.20get.20span.20info.20in.20json.20output.20for.20--bless.html#246349612">(Jul 17 2021 at 23:27)</a>:</h4>
<p>Should have looked more at the output</p>



<a name="246349849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20not%20get%20span%20info%20in%20json%20output%20for%20--bless/near/246349849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20not.20get.20span.20info.20in.20json.20output.20for.20--bless.html#246349849">(Jul 17 2021 at 23:34)</a>:</h4>
<p>Thanks, that was my problem, I mixed messages</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>